package com.study.happystudy.tool;

import org.springframework.stereotype.Component;

import java.util.Random;

@Component
public class VerCodeGenerateTool {
    public String generateRandomString() {
        Random random = new Random();
        int length = 6;
//        String characters = "qwertyuiopasdfghjklzmxncbvQAZWSXEDCRFVTGBYHNUJMLKPOI123985647";
        String characters = "123985647";
        StringBuilder sb = new StringBuilder(length);
        for (int i = 0; i < length; i++) {
            sb.append(characters.charAt(random.nextInt(characters.length())));
        }
        return sb.toString();
    }
}
